package com.zhijian.wharf.entity.vo.response;

import com.zhijian.wharf.enums.MqttTopicStatusEnum;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import java.io.Serializable;
import java.util.Date;
import java.util.Objects;

/**
 * 消息主题 回显vo
 *
 * @author auto
 * @version 1.0
 * @date 2024-08-12 19:28:30
 */
@Getter
@Api(tags = "消息主题回显vo")
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class MqttTopicVo implements Serializable {

    private static final long serialVersionUID = -1;

    /**
     * 主键ID
     */
    @ApiModelProperty("主键ID")
    private Long id;

    /**
     * 主题
     */
    @ApiModelProperty("主题")
    private String topic;

    /**
     * 状态，0：未发布，1：已发布
     */
    @ApiModelProperty("状态，0：未发布，1：已发布")
    private Byte status;

    /**
     * 状态字符串
     */
    @ApiModelProperty("状态字符串")
    private String statusStr;

    /**
     * 添加人ID
     */
    @ApiModelProperty("添加人ID")
    private Long createUserId;

    /**
     * 用途备注
     */
    @ApiModelProperty("用途备注")
    private String note;

    /**
     * 添加人姓名
     */
    @ApiModelProperty("添加人姓名")
    private String createUserName;

    /**
     * 订阅用户ID串，以英文逗号隔开
     */
    @ApiModelProperty("订阅用户ID串，以英文逗号隔开")
    private String subUserIds;

    /**
     * 订阅用户姓名
     */
    @ApiModelProperty("订阅用户姓名")
    private String subUserNames;

    /**
     * 创建时间
     */
    @ApiModelProperty("创建时间")
    private String createTime;

    /**
     * 修改时间
     */
    @ApiModelProperty("修改时间")
    private String updateTime;

    public void setSubUserNames(String subUserNames) {
        this.subUserNames = subUserNames;
    }

    public void setSubUserIds(String subUserIds) {
        this.subUserIds = subUserIds;
    }

    public void setNote(String note) {
        this.note = note;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public void setTopic(String topic) {
        this.topic = topic;
    }

    public void setStatus(Byte status) {
        this.status = status;
        if (Objects.isNull(status)) {
            this.statusStr = null;
            return;
        }
        MqttTopicStatusEnum lineEnum = MqttTopicStatusEnum.getByCode(status.intValue());
        this.statusStr = Objects.nonNull(lineEnum) ? lineEnum.getDesc() : null;
    }

    public void setStatusStr(String statusStr) {
        this.statusStr = statusStr;
    }

    public void setCreateUserId(Long createUserId) {
        this.createUserId = createUserId;
    }

    public void setCreateUserName(String createUserName) {
        this.createUserName = createUserName;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public void setUpdateTime(String updateTime) {
        this.updateTime = updateTime;
    }
}